package com.eks.user.controller;

import com.eks.order.api.OrderApi;
import com.eks.user.api.UserApi;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * UserController
 *
 * @author: chenfenghai
 * @version: 1.0
 * @date: 2020-06-03 14:48
 * @blame Team
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    UserApi userApi;

    @Reference(version = "1.0.0")
    OrderApi orderApi;

    @GetMapping("/test")
    public String test(){
        return "UserController.test";
    }

    @GetMapping("/getUserName")
    public String getUserName(){
        return userApi.getUserName(null);
    }

    @GetMapping("/getOrderCode")
    public String getOrderCode(){
        return orderApi.getOrderCode();
    }
}
